<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	<xsl:output method="xml" indent="no" omit-xml-declaration="yes" />

	<!-- Sablona pro cely dokument -->
	<xsl:template match="/">
		<!-- Zpracuje postupne vsechny kapely -->
		<xsl:apply-templates select="/kapely/kapela" />
	</xsl:template>

	<!-- Vytvori sql prikaz pro vlozeni kapely -->
	<xsl:template match="kapela">
		<!-- TODO increment id -->
		<xsl:text>
			INSERT INTO hudba (id, kapela)
				VALUES (</xsl:text>
		<xsl:value-of select="position()" />
		<xsl:text>, XMLTYPE( '</xsl:text>
		<xsl:copy-of select="." />
		<xsl:text>' ) );</xsl:text>
	</xsl:template>
</xsl:stylesheet>
